﻿using System;
using System.Windows;
using System.Windows.Input;
using System.Reflection;

namespace Oxage.Rasterizer
{
	public partial class MainWindow : Window
	{
		public MainWindow()
		{
			InitializeComponent();

			//Window header
			this.Title = string.Format("{0} v{1}", Settings.ProductName ?? "xbraster", Settings.ProductVersion);

			this.KeyDown += (sender, e) =>
			{
				if ((Keyboard.Modifiers & ModifierKeys.Control) > 0 && e.Key == Key.S)
				{
					//Keyboad shortcut for printing
					view.ViewModel.BrowseAndSave();
				}
				else if ((Keyboard.Modifiers & ModifierKeys.Control) > 0 && e.Key == Key.O)
				{
					//Keyboad shortcut for loading
					view.ViewModel.BrowseAndLoad();
				}
			};

			//Display load button
			view.ViewModel.IsStandalone = true;
		}
	}
}
